| Example Program Needleman-Wunsch Algorithm Needleman-Wunsch alignment code example This code example illustrates a graph-based Needleman-Wunsch alignment
1 | #include <seqan/graph_align.h>
| 2 | #include <iostream>
| 3 |
| 4 | using namespace seqan;
| 5 |
| 6 | int main() {
| 7 | typedef String<char> TString;
| 8 | typedef StringSet<TString, Dependent<> > TStringSet;
| 9 | typedef Graph<Alignment<TStringSet, void> > TGraph;
|
10 | TStringSet str;
| 11 | TString str0("Myannealing");appendValue(str, str0);
| 12 | TString str1("annual"); appendValue(str, str1);
|
13 | Score<int> score_type = Score<int>(0,-1,-1,0);
|
15 | int score = globalAlignment(g, score_type, NeedlemanWunsch() );
|
16 | std::cout << "Scoring schema: Match=0, Mismatch=-1, Gap=-1" << std::endl;
| 17 | std::cout << g << std::endl;
| 18 | std::cout << "Score: " << score << std::endl;
|
19 | AlignConfig<true,false,false,true> ac;
|
20 | int score2 = globalAlignment(stringSet(g), score_type, ac, NeedlemanWunsch() );
|
21 | std::cout << "Score with ends free-space alignment: " << score2 << std::endl;
| 22 | return 0;
| 23 | }
|
|